﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Microsoft.Xna.Framework;

namespace WorldOnFire
{
    public class ABCEvent
    {
        public enum eEventID
        {
            INPUT_SELECT,
            INPUT_GRAVITY_BEAM_SELECT,
            INPUT_GRAVITY_BEAM_MOVE,
            CAMERA_MOVE,
            CAMERA_SET_POSITION,
            CAMERA_ROTATE,
            CAMERA_LOOK_AT,
            OBJECT_EXPLOSION,
            OBJECT_GRAVITY_WELL,
            OBJECT_BLACK_HOLE,
            OBJECT_EMP,
            OBJECT_RELAY,
            COUNT
        }

        public eEventID eID;

        public ABCEvent()
        {

        }
    }

    public class CEventCameraMove : ABCEvent
    {
        public Vector3 vVelocity;
        public bool bLocal;

        public CEventCameraMove(Vector3 _vVelocity, bool _bLocal)
        {
            eID = eEventID.CAMERA_MOVE;

            vVelocity = _vVelocity;
            bLocal = _bLocal;
        }
    }

    public class CEventCameraSetPosition : ABCEvent
    {
        public Vector3 vPosition;

        public CEventCameraSetPosition(Vector3 _vPosition)
        {
            eID = eEventID.CAMERA_SET_POSITION;

            vPosition = _vPosition;
        }
    }

    public class CEventCameraRotate : ABCEvent
    {
        public enum eAxisID
        {
            X,
            Y,
            Z,
            COUNT
        }

        public eAxisID eAxis;
        public float fRotationSpeed;
        public bool bLocal;

        public CEventCameraRotate(eAxisID _eAxis, float _fRotationSpeed, bool _bLocal)
        {
            eID = eEventID.CAMERA_ROTATE;

            eAxis = _eAxis;
            fRotationSpeed = _fRotationSpeed;
            bLocal = _bLocal;
        }
    }

    public class CEventCameraLookAt : ABCEvent
    {
        public Vector3 vLookAtPosition;
        public Vector3 vCameraPosition;

        public CEventCameraLookAt(Vector3 _vLookAtPosition, Vector3 _vCameraPosition)
        {
            eID = eEventID.CAMERA_LOOK_AT;

            vLookAtPosition = _vLookAtPosition;
            vCameraPosition = _vCameraPosition;
        }
    }

    public class CEventObjectExplosion : ABCEvent
    {
        public Vector3 vPosition;
        public float fRadius;
        public float fEffect;

        public CEventObjectExplosion(Vector3 _vPosition, float _fRadius, float _fDamage)
        {
            eID = eEventID.OBJECT_EXPLOSION;

            vPosition = _vPosition;
            fRadius = _fRadius;
            fEffect = _fDamage;
        }
    }

    public class CEventObjectGravityWell: CEventObjectExplosion
    {
        public CEventObjectGravityWell(Vector3 _vPosition, float _fRadius, float _fAppliedForce)
            : base(_vPosition, _fRadius, _fAppliedForce)
        {
            eID = eEventID.OBJECT_GRAVITY_WELL;
        }
    }

    public class CEventObjectBlackHole : CEventObjectExplosion
    {
        public CEventObjectBlackHole(Vector3 _vPosition, float _fRadius, float _fAppliedForce)
            : base(_vPosition, _fRadius, _fAppliedForce)
        {
            eID = eEventID.OBJECT_BLACK_HOLE;
        }
    }

    public class CEventObjectEMP : CEventObjectExplosion
    {
        public CEventObjectEMP(Vector3 _vPosition, float _fRadius, float _fTimeDisabled)
            : base(_vPosition, _fRadius, _fTimeDisabled)
        {
            eID = eEventID.OBJECT_EMP;
        }
    }

    public class CEventObjectRelay : CEventObjectExplosion
    {
        public int nRelayID;

        public CEventObjectRelay(Vector3 _vPosition, float _fRadius, int _nRelayID)
            : base(_vPosition, _fRadius, 0.0f)
        {
            eID = eEventID.OBJECT_RELAY;

            nRelayID = _nRelayID;
        }
    }
}
